By chance, cmake was installed by homebrew without any restrictions,
and so version 4.0.2 happened to be installed which does no longer
use the option "--force-new-ctest-process". Changed the analysis to
look for "/bin/ctest" instead. This should work for a long time.
Task-number: PYSIDE-2221
Change-Id: Idc16063953ba82d4053cc60a7e0ef11b71b7b571
Pick-to: 6.9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit
03de4672557d80b34f9c9ef1e654a4117c621e65)
Gbp-Pq: Name testing-fix-finding-tests-on-new-cmake-versions.patch
Helper for _find_ctest() that finds the ctest binary in a build
system file (ninja, Makefile).
"""
- look_for = "--force-new-ctest-process"
+ # Looking for a command ending this way:
+ look_for = "\\ctest.exe" if "win32" in sys.platform else "/ctest"
line = None
with open(file_name) as makefile:
for line in makefile:
raise RuntimeError(msg)
# the ctest program is on the left to look_for
assert line, "Did not find {}".format(look_for)
- ctest = re.search(r'(\S+|"([^"]+)")\s+' + look_for, line).groups()
+ look = re.escape(look_for)
+ ctest = re.search(fr'(\S+{look}|"([^"]+{look})")', line).groups()
return ctest[1] or ctest[0]
def _find_ctest(self):